<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Title2')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title2" class="form-control" name="row[title2]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Category_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-category_id" data-rule="required" data-source="category/selectpage" data-params='{"custom[pid]":"41","custom[status]":"normal"}' class="form-control selectpage" name="row[category_id]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Indexs')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-indexs" class="form-control " rows="5" name="row[indexs]" cols="50"></textarea>
        </div>
    </div>
    <!-- 封面上传组件 -->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group" style="display: flex;">
                <input id="c-image" class="form-control" size="50" name="row[image]" data-rule="" type="hidden">
                <div class="input-group no-border no-padding">
                    <span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-multipart={"module":"h/newspic"} data-maxcount="3" data-maxsize="500k" data-input-id="c-image" data-mimetype="image/jpeg,image/png,image/jpg" data-multiple="true" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
                <span style="margin: 7px 10px;display: block;">支持1-3张图，图片1024*1024，1:1格式，小余500kb</span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-image"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Display_mode')}:</label>
        <div class="col-xs-12 col-sm-8">

            <select  id="c-display_mode" data-rule="required" class="form-control selectpicker" name="row[display_mode]">
                {foreach name="displayModeList" item="vo"}
                    <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">

            <select  id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
                {foreach name="typeList" item="vo"}
                    <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <!-- 图片新闻模式 - 图片上传 -->
    <div class="form-group images-upload" style="display:none">
        <label class="control-label col-xs-12 col-sm-2">{:__('images')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group" style="display: flex;">
                <input id="c-images" class="form-control" size="50" name="row[images]" data-rule="" type="hidden">
                <div class="input-group no-border no-padding">
                    <span><button type="button" id="plupload-images" class="btn btn-danger plupload" data-multipart={"module":"h/newspic"} data-maxsize="800k" data-input-id="c-images" data-mimetype="image/jpeg,image/png,image/jpg" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                </div>
                <span style="margin: 7px 20px;display: block;">建议图片1280*1280，1:1格式，小余800kb</span>
                <span class="msg-box n-right" for="c-images"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-images" data-template="imagestpl" data-name="row[images_intro]"></ul>
            <textarea name="row[images_intro]" class="form-control" style="margin-top:5px;display:none;"></textarea>
        </div>
    </div>
    <script type="text/html" id="imagestpl">
        <li class="col-xs-12" style="display: flex;">
            <div style="width:100px;height:110px;">
                <a style="padding:5px;;width:100px;height:90px;margin-bottom:0;border-radius: 0;" href="<%=fullurl%>" data-url="<%=url%>" target="_blank" class="thumbnail">
                    <img style="width:100%;height:100%;" src="<%=fullurl%>" class="img-responsive">
                </a>
                <a style="width:100px;height:20px;border-radius: 0" href="javascript:;" class="btn btn-danger btn-xs btn-trash"><i class="fa fa-trash"></i></a>
            </div>
            <textarea style="width:100%;height:110px;margin-left:10px;resize:none;" name="row[images_intro][<%=index%>]" maxlength="100" class="form-control" placeholder="文字简介，小于100字"><%=value?value:''%></textarea>
        </li>
    </script>

    <!-- 视频上传组件 -->
    <div class="form-group video-frame" style="display:none;">
        <label class="control-label col-xs-12 col-sm-2">{:__('Video')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-video" data-rule="" class="form-control" name="row[video]" type="text" placeholder="">
        </div>
    </div>
    <!-- 外链地址 -->
    <div class="form-group outlink-newstype" style="display:none;">
        <label class="control-label col-xs-12 col-sm-2">{:__('Outlink')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-outlink" data-rule="" class="form-control" name="row[outlink]" type="text" placeholder="http://">
        </div>
    </div>

    <!-- <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-images" class="form-control" size="50" name="row[images]" type="text">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-images" class="btn btn-danger plupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-images"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-images"></ul>
        </div>
    </div> -->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-content" data-rule="required" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
        <div class="col-xs-12 col-sm-8">

            <select  id="c-weigh" data-rule="required" class="form-control selectpicker" name="row[weigh]">
                {foreach name="weighList" item="vo"}
                    <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Nfrom')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-nfrom" data-rule="required" class="form-control" value="湛江购房网" name="row[nfrom]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Skey')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-skey" class="form-control" name="row[skey]" type="text" placeholder="多关键字请用 “,” 号隔开">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Commentswitch')}:</label>
        <div class="col-xs-12 col-sm-8">

            <select  id="c-commentswitch" class="form-control selectpicker" name="row[commentswitch]">
                {foreach name="commentswitchList" item="vo"}
                    <option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Titlecolorlist')}:</label>
        <div class="col-xs-12 col-sm-8">

            <select  id="c-titlecolorlist" class="form-control selectpicker" name="row[titlecolorlist]">
                {foreach name="titlecolorlistList" item="vo"}
                    <option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Titleboldswitch')}:</label>
        <div class="col-xs-12 col-sm-8">

            <select  id="c-titleboldswitch" class="form-control selectpicker" name="row[titleboldswitch]">
                {foreach name="titleboldswitchList" item="vo"}
                    <option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Hits')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-hits" data-rule="required" class="form-control" name="row[hits]" type="number" value="0" disabled="disabled">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Addhits')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-addhits" data-rule="required" class="form-control" name="row[addhits]" type="number" value="0">
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-admin_id" class="form-control" name="row[admin_id]" type="hidden" value="{:$auth->id}">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
